export const respUtil = {
  getFileName(response: any) {
    let fileName = '下载文件'
    const { headers } = response
    if (headers && headers['content-disposition']) {
      const name = headers['content-disposition'].match(/filename=(.*)/)
      if (name) {
        fileName = name[1].replaceAll('%2F', '_') //把 / 替换成 _
      }
    }
    return decodeURI(fileName)
  }
}
